﻿using Simple.Common.Helpers;

namespace Simple.Services;

public class ClassesModel : ModelBase
{
    /// <summary>
    /// 主键
    /// </summary>
    public Guid? Id { get; set; }

    /// <summary>
    /// 所属园区Id
    /// </summary>
    [Required(ErrorMessage = "所属园区不能为空")]
    public Guid? GardenId { get; set; }

    /// <summary>
    /// 所属园区
    /// </summary>
    public string? GardenName { get; set; }

    /// <summary>
    /// 班级名称
    /// </summary>
    [Required(ErrorMessage = "班级名称不能为空"),
        MaxLength(64, ErrorMessage = "班级名称长度不能超过64个字符")]
    public string Name { get; set; } = "";

    /// <summary>
    /// 开班时间
    /// </summary>
    public DateTime? OpenTime { get; set; }

    /// <summary>
    /// 教师Id
    /// 多个用逗号隔开
    /// </summary>
    public string? TeacherIds { get; set; }

    /// <summary>
    /// 教师
    /// </summary>
    public string? TeacherName { get; set; }

    /// <summary>
    /// 教室Id
    /// </summary>
    [Required(ErrorMessage = "教室不能为空")]
    public Guid? ClassroomId { get; set; }

    /// <summary>
    /// 教室名称
    /// </summary>
    [Required(ErrorMessage = "教室不能为空")]
    public string? ClassroomName { get; set; }

    /// <summary>
    /// 保育员ids
    /// </summary>
    public string? NurseIds { get; set; }

    /// <summary>
    /// 保育员名称
    /// </summary>
    public string? NurseName { get; set; }

    /// <summary>
    /// 是否归档
    /// </summary>
    public bool IsArchived { get; set; } = false;

    /// <summary>
    /// 归档时间
    /// </summary>
    public DateTime? ArchiveTime { get; set; }

    /// <summary>
    /// 班级人数
    /// </summary>
    public int ChildCount { get; set; } = 0;

    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<SysClasses, ClassesModel>();

        profile.CreateMap<ClassesModel, SysClasses>();

    }

}
